Skip to content

Conversation

@yiqingy0
Copy link
Collaborator

@yiqingy0 yiqingy0 commented Aug 14, 2025

Summary by CodeRabbit

  • Chores

    • Downstream L0 tests can now opt to reuse prior build artifacts to speed CI runs.
    • Test runs can skip previously passed tests when a reuse artifact path is provided, reducing redundant execution.
    • Added a utility to extract passed test names and update test lists automatically.
  • Tests

    • One end-to-end test is currently forced to fail, causing a deterministic test failure.

Description

Test Coverage

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 14, 2025

📝 Walkthrough

Walkthrough

Passes reuseBuild into downstream L0 launches, adds conditional reuse of prior test results by downloading and pruning passed tests, introduces a CLI Python utility to extract/remove passed tests from JUnit results, and makes an integration test fail immediately.

Changes

Cohort / File(s) Summary
Pipeline fan-out parameterization
jenkins/L0_MergeRequest.groovy
Replaced literal false with reuseBuild when calling launchJob for downstream L0 jobs (x86_64 and SBSA single/multi-GPU) so the downstream job can receive reuseBuild and optionally set reuseArtifactPath.
L0 test reuse flow
jenkins/L0_Test.groovy
Adds REUSE_ARTIFACT_PATH = env.reuseArtifactPath and a new function def reusePassedTests(pipeline, llmSrc, reusedArtifactPath, stageName, testListFile). When REUSE_ARTIFACT_PATH is set, code downloads previous results, extracts passed tests, and removes them from the current test list in both Slurm multi-node and platform run paths; adds logging and error handling; call sites updated to pass llmSrc.
Result reuse utility script
jenkins/scripts/reuse_passed_tests.py
New script with get_passed_tests(input_file, output_file) and remove_passed_tests(input_file, passed_tests_file) plus a small argparse CLI. Parses JUnit XML to list passed tests and filters them from a test list; imports test_rerun.parse_name.
Integration test behavior change
tests/integration/defs/test_e2e.py
test_openai_chat_example now immediately calls pytest.fail("test_openai_chat_example"), causing a deterministic early test failure.

Sequence Diagram(s)

sequenceDiagram
    participant MR as L0_MergeRequest
    participant L0 as L0_Test job
    participant Store as Artifact Storage
    participant Script as reuse_passed_tests.py

    MR->>L0: launchJob(..., reuseBuild)
    alt reuseBuild provided
        L0->>Store: download results-<stage>.tar.gz
        L0->>L0: extract results.xml
        L0->>Script: get_passed_tests(results.xml -> passed_tests.txt)
        L0->>Script: remove_passed_tests(test_list.txt, passed_tests.txt)
        L0->>L0: run tests with pruned test_list
    else reuseBuild not provided
        L0->>L0: run tests with full test_list
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • niukuo
  • chzblych
  • ZhanruiSunCh
  • EmmaQiaoCh

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f5c575 and a8b8290.

📒 Files selected for processing (2)
  • jenkins/L0_Test.groovy (4 hunks)
  • jenkins/scripts/reuse_passed_tests.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • jenkins/scripts/reuse_passed_tests.py
  • jenkins/L0_Test.groovy
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15247 [ run ] triggered by Bot

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (2)
jenkins/scripts/delete_passed_tests.py (2)

40-47: Clarify messaging and exit on hard errors to aid callers.

Silent returns make upstream handling ambiguous. Return non-zero exit codes on hard failures; adjust messages to reflect expected file types.

Apply this diff:

-    if not os.path.exists(input_file):
-        print(f"Input file {input_file} does not exist")
-        return
+    if not os.path.exists(input_file):
+        print(f"Input test list file {input_file} does not exist", file=sys.stderr)
+        sys.exit(1)
     if not os.path.exists(passed_tests_file):
-        print(f"Passed tests file {passed_tests_file} does not exist")
-        return
+        print(f"Passed tests file {passed_tests_file} does not exist", file=sys.stderr)
+        sys.exit(1)

72-92: Harden CLI: check args length and fix help text for remove_passed_tests.

  • Accessing sys.argv[1] without length check can crash.
  • remove_passed_tests --input-file is a test list, not an XML; correct the help.

Apply this diff:

 if __name__ == '__main__':
-    if (sys.argv[1] == "get_passed_tests"):
+    if len(sys.argv) < 2:
+        print("Expected subcommand: get_passed_tests | remove_passed_tests", file=sys.stderr)
+        sys.exit(2)
+    if (sys.argv[1] == "get_passed_tests"):
         parser = argparse.ArgumentParser()
         parser.add_argument('--input-file',
                             required=True,
                             help='Input XML file containing test results')
         parser.add_argument('--output-file',
                             required=True,
                             help='Output file to write passed tests')
         args = parser.parse_args(sys.argv[2:])
         get_passed_tests(args.input_file, args.output_file)
     elif (sys.argv[1] == "remove_passed_tests"):
         parser = argparse.ArgumentParser()
         parser.add_argument('--input-file',
                             required=True,
-                            help='Input XML file containing test results')
+                            help='Input test list file (one test name per line)')
         parser.add_argument('--passed-tests-file',
                             required=True,
                             help='File containing passed tests')
         args = parser.parse_args(sys.argv[2:])
         remove_passed_tests(args.input_file, args.passed_tests_file)
+    else:
+        print(f"Unknown subcommand: {sys.argv[1]}", file=sys.stderr)
+        sys.exit(2)
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5cd8c0f and fe9bc47.

📒 Files selected for processing (4)
  • jenkins/L0_MergeRequest.groovy (4 hunks)
  • jenkins/L0_Test.groovy (4 hunks)
  • jenkins/scripts/delete_passed_tests.py (1 hunks)
  • tests/integration/defs/test_e2e.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else

Files:

  • tests/integration/defs/test_e2e.py
  • jenkins/scripts/delete_passed_tests.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • tests/integration/defs/test_e2e.py
  • jenkins/scripts/delete_passed_tests.py
🔇 Additional comments (3)
jenkins/L0_MergeRequest.groovy (3)

1042-1042: Verify reuseBuild is a valid build number or handled as a sentinel

Forwarding reuseBuild to launchJob(...) is fine, but confirm upstream only supplies a numeric build ID, null, or a known sentinel (e.g., "latest"). A non-numeric value may produce an invalid reuseArtifactPath.

  • Location to check:

    • jenkins/L0_MergeRequest.groovy — line ~1042
    • Snippet:
      launchJob("L0_Test-x86_64-Single-GPU", reuseBuild, enableFailFast, globalVars, "x86_64", additionalParameters)
      
  • Recommended hardening for launchJob(...):

    • Accept reuseBuild values: null (derive last successful), "latest" (treat as last successful), or a numeric build ID.
    • Validate before constructing paths (e.g., numeric check via regex /^\d+$/ or try Integer.parseInt; or use reuseBuild.isInteger() where appropriate). If invalid, skip reuse and log a warning.
    • Also validate/whitelist inputs from the upstream bot if possible.

I can provide a small patch to implement these guards if you want.


1098-1098: Incorrect — reuseBuild is already validated in launchJob; no extra check needed for the Multi-GPU call

launchJob(...) guards construction of reuseArtifactPath with a truthy check on reuseBuild, so passing reuseBuild into the Multi-GPU invocation is safe.

  • jenkins/L0_MergeRequest.groovy: def launchJob(...) at line 969 — validates reuseBuild before setting parameters['reuseArtifactPath'] (lines ~995–996).
  • jenkins/L0_MergeRequest.groovy: Multi-GPU invocation at line 1098 — launchJob("L0_Test-x86_64-Multi-GPU", reuseBuild, ...)

If you want "default to last successful pipeline" behavior when reuseBuild is omitted, that’s a separate behavior change to implement intentionally.

Likely an incorrect or invalid review comment.


1200-1200: No change needed — SBSA multi‑GPU already has the same reuse/guard logic

Short verification: I inspected jenkins/L0_MergeRequest.groovy — the SBSA test path contains the same gating and error/commit-guard behaviour as the x86 path (it tracks singleGpuTestFailed, checks requireMultiGpuTesting, blocks multi‑GPU when single‑GPU failed except on PostMerge, then calls launchJob with reuseBuild).

Relevant locations:

  • jenkins/L0_MergeRequest.groovy — reuseBuild set from gitlab params (around line ~134)
  • launchJob(...) definition (around line ~969)
  • x86 multi‑GPU gating & launch (around lines ~1098)
  • SBSA single‑GPU gating, requireMultiGpuTesting check and the multi‑GPU launch (launchJob("L0_Test-SBSA-Multi-GPU", ...) at line 1200; gating logic just above)

Action: Ignore the original suggestion to replicate reuse/commit‑guard logic — it’s already present.

Likely an incorrect or invalid review comment.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15249 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15247 [ run ] completed with state ABORTED

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🔭 Outside diff range comments (1)
jenkins/scripts/reuse_passed_tests.py (1)

74-95: Replace brittle sys.argv dispatch with argparse subparsers; fix help text mismatch

  • Accessing sys.argv[1] unguarded raises IndexError when invoked without args.
  • Use subparsers for robust UX and built-in help.
  • Update help for remove_passed_tests to reflect it expects a test list file, not XML.

Apply this diff:

-if __name__ == '__main__':
-    if (sys.argv[1] == "get_passed_tests"):
-        parser = argparse.ArgumentParser()
-        parser.add_argument('--input-file',
-                            required=True,
-                            help='Input XML file containing test results')
-        parser.add_argument('--output-file',
-                            required=True,
-                            help='Output file to write passed tests')
-        args = parser.parse_args(sys.argv[2:])
-        get_passed_tests(args.input_file, args.output_file)
-    elif (sys.argv[1] == "remove_passed_tests"):
-        parser = argparse.ArgumentParser()
-        parser.add_argument('--input-file',
-                            required=True,
-                            help='Input XML file containing test results')
-        parser.add_argument('--passed-tests-file',
-                            required=True,
-                            help='File containing passed tests')
-        args = parser.parse_args(sys.argv[2:])
-        remove_passed_tests(args.input_file, args.passed_tests_file)
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(
+        description='Extract and manipulate passed tests from JUnit XML reports and test lists.'
+    )
+    subparsers = parser.add_subparsers(dest='command', required=True)
+
+    gp = subparsers.add_parser('get_passed_tests', help='Extract passed tests from a JUnit XML report')
+    gp.add_argument('--input-file', required=True, help='Input JUnit XML file containing test results')
+    gp.add_argument('--output-file', required=True, help='Output file to write passed tests (one per line)')
+
+    rp = subparsers.add_parser('remove_passed_tests', help='Remove passed tests from a test list file')
+    rp.add_argument('--input-file', required=True, help='Input file containing tests to run (one per line)')
+    rp.add_argument('--passed-tests-file', required=True, help='File containing passed tests (one per line)')
+
+    args = parser.parse_args()
+    if args.command == 'get_passed_tests':
+        get_passed_tests(args.input_file, args.output_file)
+    elif args.command == 'remove_passed_tests':
+        remove_passed_tests(args.input_file, args.passed_tests_file)
🧹 Nitpick comments (5)
jenkins/scripts/reuse_passed_tests.py (5)

9-13: Add type hints and a docstring to get_passed_tests

Public functions should have clear interfaces and Google-style docstrings.

Apply this diff:

-def get_passed_tests(input_file, output_file):
+def get_passed_tests(input_file: str, output_file: str) -> None:
+    """Extract names of passed tests from a JUnit XML report.
+
+    A test is considered "passed" if it has no <failure>, <error>, or <skipped> child.
+
+    Args:
+        input_file: Path to the JUnit XML file.
+        output_file: Path to the file where passed tests are written (one per line).
+    """
     if not os.path.exists(input_file):
-        print(f"Input file {input_file} does not exist")
+        print(f"Input file {input_file} does not exist", file=sys.stderr)
         return

36-39: Write with explicit UTF-8 encoding

Be explicit about file encoding to avoid locale-dependent behavior on Jenkins workers.

Apply this diff:

-    with open(output_file, 'w') as f:
+    with open(output_file, 'w', encoding='utf-8') as f:
         for test in passed_tests:
             f.write(test + '\n')

10-12: Send error messages to stderr

Error logs should go to stderr to avoid polluting stdout which may be consumed by downstream tooling.

Apply this diff:

-        print(f"Input file {input_file} does not exist")
+        print(f"Input file {input_file} does not exist", file=sys.stderr)
@@
-        print(f"Input file {input_file} does not exist")
+        print(f"Input file {input_file} does not exist", file=sys.stderr)
@@
-        print(f"Passed tests file {passed_tests_file} does not exist")
+        print(f"Passed tests file {passed_tests_file} does not exist", file=sys.stderr)
@@
-        print(f"Failed to delete {input_file}: {e}")
+        print(f"Failed to delete {input_file}: {e}", file=sys.stderr)

Also applies to: 43-49, 67-67


1-95: Confirm exit-code semantics for missing files

Currently, missing files print a message and return 0 (success). This may be intentional in the reuse-artifacts flow (no-op when artifacts are absent). Please confirm the desired behavior so CI logic relying on command success/failure remains correct.

If you prefer non-zero exit codes for specific failure modes, I can wire that in and update the Groovy caller(s) accordingly.


1-95: Add minimal unit tests for core logic

Recommend adding small unit tests for:

  • JUnit root being vs
  • Handling of passed/failure/error/skipped
  • remove_passed_tests filtering, including blank lines and duplicates

I can scaffold pytest-based tests under a tests/ folder and wire into CI if you want.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe9bc47 and 44132f1.

📒 Files selected for processing (1)
  • jenkins/scripts/reuse_passed_tests.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else

Files:

  • jenkins/scripts/reuse_passed_tests.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • jenkins/scripts/reuse_passed_tests.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15252 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15249 [ run ] completed with state ABORTED

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (3)
jenkins/L0_Test.groovy (3)

354-357: Pass required context into reusePassedTests (pipeline, llmSrc) to avoid runtime failures.

The current implementation of reusePassedTests references pipeline and llmSrc internally but they aren’t in scope. Pass both explicitly from here. Also aligns with the corrected function signature below.

-                // Reuse passed tests
-                if (REUSE_ARTIFACT_PATH) {
-                    reusePassedTests(REUSE_ARTIFACT_PATH, stageName, testListPath)
-                }
+                // Reuse passed tests
+                if (REUSE_ARTIFACT_PATH) {
+                    reusePassedTests(this, llmSrcLocal, REUSE_ARTIFACT_PATH, stageName, testListPath)
+                }

1452-1456: Pass context to reusePassedTests here as well (pipeline and llmSrc).

Mirror the fix from the multinode path so both call sites are consistent and functional.

-        // Reuse passed tests
-        if (REUSE_ARTIFACT_PATH) {
-            reusePassedTests(REUSE_ARTIFACT_PATH, stageName, testDBList)
-        }
+        // Reuse passed tests
+        if (REUSE_ARTIFACT_PATH) {
+            reusePassedTests(this, llmSrc, REUSE_ARTIFACT_PATH, stageName, testDBList)
+        }

1072-1105: Fix undefined vars, quoting, logging, backup path, and wrong helper-script name in reusePassedTests

Verified:

  • jenkins/scripts/reuse_passed_tests.py exists and defines get_passed_tests (line 9) and remove_passed_tests (line 42).
  • jenkins/L0_Test.groovy currently references delete_passed_tests.py (matches at lines 1082 and 1093) and uses undefined variables pipeline and llmSrc.

Actionable changes (apply the refactor below; it switches to reuse_passed_tests.py and fixes signature, quoting, logging, and backup):

  • Files to update:
    • jenkins/L0_Test.groovy (function reusePassedTests, ~lines 1072–1105; references at 1082 & 1093)
    • Ensure calls point to jenkins/scripts/reuse_passed_tests.py

Proposed diff:

-def reusePassedTests(reusedArtifactPath, stageName, testListFile) {
-    def reusedPath = "${WORKSPACE}/reused"
-    sh "mkdir -p ${reusedPath}"
-    def resultsFileName = "results-${stageName}"
-    def passedTestsFile = "${reusedPath}/${stageName}/passed_tests.txt"
-    try {
-        trtllm_utils.llmExecStepWithRetry(pipeline, script: "cd ${reusedPath} && wget -nv https://urm.nvidia.com/artifactory/${reusedArtifactPath}/test-results/${resultsFileName}.tar.gz")
-        sh "cd ${reusedPath} && tar -zxf ${resultsFileName}.tar.gz"
-        // Get passed tests
-        sh """
-            python3 ${llmSrc}/jenkins/scripts/delete_passed_tests.py \
-            get_passed_tests \
-            --input-file=${reusedPath}/${stageName}/results.xml \
-            --output-file=${passedTestsFile}
-        """
-        sh "The passed tests are: $(cat ${passedTestsFile})"
-
-        // Copy the original test file to a new file
-        sh "cp ${testListFile} original_${testListFile}"
-        // Remove passed tests from original test file
-        sh """
-            python3 ${llmSrc}/jenkins/scripts/delete_passed_tests.py \
-            remove_passed_tests \
-            --input-file=${testListFile} \
-            --passed-tests-file=${passedTestsFile}
-        """
-        sh "The test list after removing passed tests is: $(cat ${testListFile})"
-    } catch (InterruptedException e) {
-        throw e
-    } catch (Exception e) {
-        echo "Failed to get passed tests: ${e.message}"
-    }
-}
+def reusePassedTests(pipeline, llmSrc, reusedArtifactPath, stageName, testListFile) {
+    def reusedPath = "${WORKSPACE}/reused"
+    sh "mkdir -p '${reusedPath}'"
+    def resultsFileName = "results-${stageName}"
+    def passedTestsFile = "${reusedPath}/${stageName}/passed_tests.txt"
+    try {
+        def resultsUrl = reusedArtifactPath?.startsWith("http") ?
+            "${reusedArtifactPath}/test-results/${resultsFileName}.tar.gz" :
+            "https://urm.nvidia.com/artifactory/${reusedArtifactPath}/test-results/${resultsFileName}.tar.gz"
+        trtllm_utils.llmExecStepWithRetry(pipeline, script: "cd '${reusedPath}' && wget -nv '${resultsUrl}'")
+        sh "cd '${reusedPath}' && tar -zxf '${resultsFileName}.tar.gz'"
+        // Get passed tests
+        sh """
+            python3 '${llmSrc}/jenkins/scripts/reuse_passed_tests.py' \
+            get_passed_tests \
+            --input-file='${reusedPath}/${stageName}/results.xml' \
+            --output-file='${passedTestsFile}'
+        """
+        sh "echo \"Passed tests count: \$(wc -l < '${passedTestsFile}' || echo 0)\""
+
+        // Backup the original test file alongside it
+        sh "cp '${testListFile}' '${testListFile}.orig'"
+        // Remove passed tests from the original test file in-place
+        sh """
+            python3 '${llmSrc}/jenkins/scripts/reuse_passed_tests.py' \
+            remove_passed_tests \
+            --input-file='${testListFile}' \
+            --passed-tests-file='${passedTestsFile}'
+        """
+        sh "echo \"Remaining tests count: \$(wc -l < '${testListFile}' || echo 0)\""
+    } catch (InterruptedException e) {
+        throw e
+    } catch (Exception e) {
+        echo "Failed to reuse passed tests: ${e.message}"
+    }
+}

Notes:

  • Verified helper script is reuse_passed_tests.py (CLI functions get_passed_tests/remove_passed_tests exist). Update the Groovy calls to that script (replaces delete_passed_tests.py).
  • Signature change required: accept pipeline and llmSrc as parameters.
  • Quoting and echo usage prevent shell injection and broken outputs; backup now uses .orig suffix next to original file.
🧹 Nitpick comments (1)
jenkins/L0_Test.groovy (1)

28-29: Initialize REUSE_ARTIFACT_PATH defensively (trim to avoid false positives).

Minor: trim any accidental whitespace so the boolean checks behave predictably.

-REUSE_ARTIFACT_PATH = env.reuseArtifactPath
+REUSE_ARTIFACT_PATH = env.reuseArtifactPath?.trim()
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44132f1 and 9f5c575.

📒 Files selected for processing (1)
  • jenkins/L0_Test.groovy (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check

@yiqingy0 yiqingy0 force-pushed the reuse_passed_tests branch from 9f5c575 to 13f9ec8 Compare August 14, 2025 07:32
@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

1 similar comment
@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15252 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #11516 (Partly Tested) completed with status: 'FAILURE'

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15255 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15261 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15255 [ run ] completed with state ABORTED

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15264 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15261 [ run ] completed with state ABORTED

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15268 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15268 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #11527 (Partly Tested) completed with status: 'FAILURE'

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15287 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15287 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #11540 (Partly Tested) completed with status: 'FAILURE'

@yiqingy0
Copy link
Collaborator Author

/bot run --stage-list "A10-TensorRT-1,A10-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15403 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15403 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #11610 (Partly Tested) completed with status: 'FAILURE'

@yiqingy0 yiqingy0 marked this pull request as ready for review November 12, 2025 04:48
@yiqingy0 yiqingy0 requested review from a team as code owners November 12, 2025 04:48
@yiqingy0 yiqingy0 requested review from kxdc and venkywonka November 12, 2025 04:48
@yiqingy0
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24247 [ run ] triggered by Bot. Commit: 6a2b1b2

@yiqingy0
Copy link
Collaborator Author

/bot kill

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24252 [ kill ] triggered by Bot. Commit: 6a2b1b2

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24247 [ run ] completed with state ABORTED. Commit: 6a2b1b2
LLM/main/L0_MergeRequest_PR #18292 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24252 [ kill ] completed with state SUCCESS. Commit: 6a2b1b2
Successfully killed previous jobs for commit 6a2b1b2

@yiqingy0
Copy link
Collaborator Author

/bot run --disable-reuse-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24404 [ run ] triggered by Bot. Commit: 6a2b1b2

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24404 [ run ] completed with state FAILURE. Commit: 6a2b1b2
/LLM/main/L0_MergeRequest_PR pipeline #18414 completed with status: 'FAILURE'

@yiqingy0 yiqingy0 marked this pull request as draft November 13, 2025 08:22
@yiqingy0
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24469 [ run ] triggered by Bot. Commit: bd80d98

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24469 [ run ] completed with state SUCCESS. Commit: bd80d98
/LLM/main/L0_MergeRequest_PR pipeline #18464 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants